package lesson2;

import org.testng.Assert;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;

/**
 * Created with IntelliJ IDEA.
 * User: admin
 * Date: 05.03.14
 * Time: 20:55
 * To change this template use File | Settings | File Templates.
 */
public class Homework1 {

    @DataProvider(name = "test1")
    public Object[][] provideData() {

        int[] array = {10,20,30};

        return new Object[][] {{array}};
    }

    @Test(dataProvider = "test1")
    public void testingTest2(int[] array){


        final int ExpectedTestResult = 0;
        int lenght = array.length;

        int sortUp = 0;
        for (int i = 0; i < lenght - 1; i++){
            if (array[i] > array[i+1])
                sortUp++;
        }

        Assert.assertEquals(sortUp, ExpectedTestResult);
    }
}
